package org.zfes.snowier.cloud.zbss.metting.router.service.user;

import java.util.Map;
import java.util.Optional;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.cloud.zbss.metting.biz.model.MettingsMsg;
import org.zfes.snowier.cloud.zbss.metting.biz.service.IMettingsMsgService;
@Controller 
@RequestMapping("/auth/mettingsMsg")
public class MettingsMsgController extends BaseController {

	
	@Autowired
	private IMettingsMsgService mettingsMsgService;
	
	@RequiresPermissions(value="mettingsMsg:loadMettingsMsgDataSet",desc="会议留言列表")
    @RequestMapping(value="/loadMettingsMsgDataSet", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadMettingsMsgDataSet(@RequestParam Map<String,Object> params){
	    DataSet dataSet=  mettingsMsgService.loadMettingsMsgDataSet(params);
	    return ajaxQuery("dataSet", dataSet);
    }
	
	@RequiresPermissions(value="mettingsMsg:createMettingsMsg",desc="会议留言添加")
    @RequestMapping(value="/createMettingsMsg", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public  @ResponseBody Object createMettingsMsg(MettingsMsg mettingsMsg){
		mettingsMsgService.createMettingsMsg(mettingsMsg);
    	return ajaxDoneSuccess("数据操作成功 ");
    }
	
	@RequiresPermissions(value="mettingsMsg:loadMettingsMsg",desc="会议留言加载")
    @RequestMapping(value="/loadMettingsMsg", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadMettingsMsg(Long id){
		Optional<MettingsMsg> ops = mettingsMsgService.loadMettingsMsgById(id);
		return ajaxQuery("mettingsMsg",ops);
    }
	
	@RequiresPermissions(value="mettingsMsg:updateMettingsMsg",desc="会议留言更新")
    @RequestMapping(value="/updateMettingsMsg", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object updateMettingsMsg(MettingsMsg mettingsMsg){
		mettingsMsgService.updateMettingsMsg(mettingsMsg);
		return ajaxDoneSuccess("数据操作成功 ");
    }
	
	@RequiresPermissions(value="mettingsMsg:deletMettingsMsg",desc="会议留言删除")
    @RequestMapping(value="/deleteMettingsMsg", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object deleteMettingsMsg(Long id){
		mettingsMsgService.deleteMettingsMsg(id);
		return ajaxDoneSuccess("数据操作成功 ");
    }

}